package com.treasure.mall.biz.service.core.live;

import com.treasure.mall.biz.base.SearchableCrudService;
import com.treasure.mall.biz.dto.live.ApplyLiveDTO;
import com.treasure.mall.biz.dto.live.LiveRecommendSaveDTO;
import com.treasure.mall.biz.entity.live.LiveRoomPO;
import com.treasure.mall.zbq.common.ienum.live.LiveEnums;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;

/**
 *
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.service.core.live
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/6/11 20:14
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * Copyright 2019-2022 com.treasure.mall.biz.service.core.live Inc. All rights reserved.
 */
public interface LiveRoomService extends SearchableCrudService<LiveRoomPO, Long> {

    /**
     * 申请
     *
     * @param applyLiveDTO
     * @return
     */
    @Transactional
    LiveRoomPO apply(ApplyLiveDTO applyLiveDTO);

    LiveRoomPO findByMerchant(Long merchantId);

    /**
     * 修改
     *
     * @param applyLiveDTO
     * @return
     */
    @Transactional
    LiveRoomPO edit(Long roomId, ApplyLiveDTO applyLiveDTO);

    @Transactional
    void sort(Long roomId, int orderWeight);

    /**
     * 审核
     *
     * @param id
     * @param auditStatus
     * @param reason
     */
    @Transactional
    void audit(Long id, LiveEnums.AuditStatus auditStatus, String reason);

    /**
     * 添加一个主播
     *
     * @param roomId
     * @param userId
     */
    @Transactional
    void addDirector(Long roomId, Long userId);

    /**
     * 关注
     *
     * @param roomId
     * @param userId
     */
    @Transactional
    void follow(Long roomId, Long userId);

    /**
     * 取消关注
     *
     * @param roomId
     * @param userId
     */
    @Transactional
    void unfollow(Long roomId, Long userId);

    @Transactional
    void enableToggle(Long roomId, boolean enabled);

    @Transactional
    void setRewardRate(Long roomId, BigDecimal rate);

    @Transactional
    void setRewardRate(Long roomId, BigDecimal rate, BigDecimal rebateRateOne, BigDecimal rebateRateTwo);

    boolean modifyPlatformType(Long id, boolean platform);

    boolean modifyRecommend(LiveRecommendSaveDTO dto);

    boolean checkDirectorUser(Long roomId, Long userId);

    /**
     * 获取用户授权的直播间列表
     *
     * @param userId
     * @return
     */
    List<LiveRoomPO> getUserAuthRoomList(Long userId);


    void modifyLivePlaying(Long roomId, boolean livePlaying);


    /**
     * 设置直播间公告
     *
     * @param roomId
     * @param notice
     */
    void setNoticeContent(Long roomId, String notice);

    void enableNotice(Long roomId, boolean enable);
}
